package ro.ubbcluj.cs.damate.managers.administration;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.io.Serializable;

/**
 * @author Lóránd Fazakas (lfazakas)
 *         Date: 2013.03.25.
 *         Time: 19:16
 */
@Component
@Scope("view")
public class AdministrationView implements Serializable {

    public enum AdminPanel {
        DESCRIPTION,
        NEW_USER,
        LIST_USERS,
        NEW_USER_GROUP,
        LIST_USER_GROUPS,
        ACTIVATE_NEW_USERS
    }

    private AdminPanel activePanel;

    @PostConstruct
    private void init() {
        this.activePanel = AdminPanel.DESCRIPTION;
    }

    public void switchPanel(String switchTo) {
        this.activePanel = AdminPanel.valueOf(switchTo);
    }

    public AdminPanel getActivePanel() {
        return activePanel;
    }

    public void setActivePanel(AdminPanel activePanel) {
        this.activePanel = activePanel;
    }
}
